Method and device for measuring flight parameters of an unmanned aerial vehicle

ABSTRACT

A method and a device for measuring flight parameters of an unmanned aerial vehicle (UAV) are provided, the method includes, capturing images and collecting an angular velocity of the UAC, extracting corner points from a current frame image, estimating an estimated area according to the angular velocity of the UAV, searching for a corresponding corner point in the estimated area, obtaining a speed of each of the corner points, obtaining a pixel velocity, and obtaining an actual speed of the UAV based on the pixel velocity and a flight altitude of the UAV.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a national phase application of InternationalApplication No. PCT/CN2014/075103, filed Apr. 10, 2014, the content ofwhich is incorporated herein by reference in its entirety.

TECHNICAL FIELD

The present disclosure relates to an unmanned aerial vehicle (UAV), andparticularly, to a method and device for measuring flight parameters ofan UAV.

BACKGROUND OF THE INVENTION

An unmanned aerial vehicle is an aerial vehicle without a human pilotonboard, and is controlled by a radio remote controller or an autonomousprogram. Flight parameters of UAV (e.g., flight velocity) may berequired to control a flight attitude of the UAV where a GPS (GlobalPositioning System) information is not available and a flight attitudeof UAV is to be controlled, for example, in hovering.

An existing method of measuring flight parameters of a UAV where GPSinformation is not available may comprise: extracting simple featurepoints from images captured by a camera sensor; measuring a pixelvelocity by a block matching method; and calculating a flight speed ofthe UAV based on an altitude information obtained by an ultrasonicsensor and the pixel velocity.

In the prior art, significant errors or faults may occur in thecalculated pixel velocity since the feature points extracted from theimages may not be corner points. In some instances, the block matchingmethod may only measure a velocity of one pixel, which may lower aprecision of measurement. For instance, a flight speed may be calculatedas zero while the UAV is moving at a low speed. Furthermore, in theprior art, a change in pixel velocity by a rotation of the UAV may notbe corrected before the pixel velocity is calculated; therefore, aneffect on the pixel velocity caused by a rotation of UAV may not becompletely removed. In the prior art, a range of measurement of UAVspeed may be limited and fail to meet a need in practical applications.

SUMMARY OF THE INVENTION

The present disclosure provides a method and device for measuring flightparameters of a UAV with high accuracy and precision.

In order to address the technical problems discussed hereinabove, thepresent disclosure provides a method of measuring flight parameters ofan unmanned aerial vehicle (UAV). The method may comprise: capturingimages and collecting an angular velocity of the UAV; extracting cornerpoints from a current frame image; estimating, for each of the cornerpoints in the current frame image, an estimated area in a previous frameimage within which the corner point in the current frame image locates,according to the angular velocity of the UAV; searching for acorresponding corner point within each of the estimated areas in theprevious frame image, according to the position of each of the cornerpoints in the current frame image; obtaining a speed of each of thecorner points according to the corner point in the current frame imageand the corresponding corner point in the previous frame image;obtaining a pixel velocity according to the speeds of the corner points;and obtaining an actual speed of the UAV based on the pixel velocity anda flight altitude of the UAV.

In some embodiments, the step of extracting corner points from thecurrent frame image may include: performing a pyramid decomposition onthe current frame image; obtaining gray-scale gradients in thehorizontal direction and the vertical direction of each pixel in the topimage layer of the current frame image, wherein the top image layerlocates at the top of the pyramid in the pyramid decomposition;obtaining an integral image corresponding to the top image layer of thecurrent frame image, based on the gray-scale gradients in the horizontaldirection and the vertical direction; and obtaining a Harris score ofeach pixel in the top image layer of the current frame image based onthe integral image, and extracting the corner points in the currentframe image based on the Harris score, wherein the corner points may bepixels having a Harris score greater than a predetermined threshold.

In some embodiments, the step of estimating, for each of the cornerpoints in the current frame image, an estimated area in a previous frameimage within which the corner point in the current frame image locates,according to the angular velocity of the UAV may include: performing apyramid decomposition on the previous frame image; integrating thecollected angular velocity over the time interval between the currentframe image and the previous frame image, to obtain a rotational angleof the UAV during the time interval; calculating, for each of the cornerpoints in the current frame image, a corresponding pixel displacement ina top image layer of the previous frame image, based on the rotationalangle; and estimating, for each of the corner points in the currentframe image, an estimated area in the top image layer of the previousframe image, based on the corresponding pixel displacement.

In some embodiments, the step of searching for the corresponding cornerpoint within each of the estimated areas in the previous frame image,according to the position of each of the corner point in the currentframe image may include: extracting corner points from the previousframe image; determining if a corner point is found within each of theestimated area in the previous frame image which is corresponding toeach of the corner points in the current frame image; and searching,within the each of the estimated areas in the previous frame, for cornerpoint corresponding to the corner point in the current frame.

In some embodiments, the step of obtaining the speeds of the cornerpoints according to the corner points in the current frame image and thecorresponding corner points in the previous frame image may include:obtaining a speed of each of the corner points in the top image layeraccording to each of the corner points in the current frame image andeach of the corner points in the previous frame image, by a pyramidoptical flow method; and obtaining successively a speed of each of thecorner points in each of image layers other than the top image layer inthe pyramid according to the speed of each of the corner points in thetop image layer, by the pyramid optical flow method, wherein a speed ofthe corner point in a bottom image layer in the pyramid is the speed ofthe corner point.

In some embodiments, the step of obtaining the pixel velocity accordingto the speeds of the corner points may include: obtaining an averagevalue of the speeds of the corner points as a first average value;determining a correlation between the speed of each of the corner pointsand the first average value; and obtaining an average value of thosecorner points which are positively correlated with the first averagevalue, as a second average value, wherein the second average value isthe pixel velocity.

In some embodiments, the step of obtaining the pixel velocity accordingto the speeds of the corner points may include: obtaining a histogram ofthe speeds of the corner points and performing a low-pass filtering onthe histogram, wherein a mode obtained from the filtered histogram isthe pixel velocity.

In some embodiments, the step of obtaining the actual speed of the UAVbased on the pixel velocity and a flight altitude of the UAV mayinclude: obtaining a rotational pixel velocity of the UAV caused by arotation based on the angular velocity; obtaining a translational pixelvelocity of the UAV caused by a translation by subtracting therotational pixel velocity caused by the rotation from the pixel velocityobtained according to the speeds of the corner points; and obtaining theactual speed of the UAV according to the translational pixel velocityand the flight altitude of the UAV.

In some embodiments, a SIMD instruction set of a processor may be usedto perform a synchronous calculation on a plurality of pixels in thestep of extracting corner points from the current frame image, the stepof searching for the corresponding corner point within each of theestimated areas in the previous frame image, according to the positionof each of the corner point in the current frame image, and the step ofobtaining the speed of each of the corner point according to the cornerpoint in the current frame image and the corresponding corner point inthe previous frame image.

In order to address the technical problem discussed hereinabove, thepresent disclosure provides a device for measuring flight parameters ofan unmanned aerial vehicle (UAV). The device may comprise: an imagesensor configured to capture images; a gyroscope configured to collectan angular velocity of the UAV; an altimeter configured to obtain aflight altitude of the UAV; and a processor electrically connected withthe image sensor, the gyroscope and the altimeter, said processor may beconfigured to: extract corner points from a current frame image capturedby the image sensor; estimate, for each of the corner points in thecurrent frame image, an estimated area in a previous frame image withinwhich the corner points in the current frame image locates, according tothe angular velocity of the UAV collected by the gyroscope; search for acorresponding corner point within each of the estimated areas in theprevious frame image, according to the position of each of the cornerpoints in the current frame image; obtain a speed of each of the cornerpoints according to the corner point in the current frame image and thecorresponding corner point in the previous frame image; obtain a pixelvelocity according to the speeds of the corner points; and obtain anactual speed of the UAV based on the pixel velocity and the flightaltitude of the UAV obtained by the altimeter.

the processor may be further configured to: perform a pyramiddecomposition on the current frame image; obtain gray-scale gradients inthe horizontal direction and the vertical direction of each pixel in thetop image layer of the current frame image, wherein the top image layerlocates at the top of the pyramid in the pyramid decomposition; obtainan integral image corresponding to the top image layer of the currentframe image based on the gray-scale gradients in the horizontaldirection and the vertical direction; obtain a Harris score of eachpixel in the top image layer of the current frame image based on theintegral image; and extract the corner points in the current frame imagebased on the Harris score, wherein the corner points are pixels having aHarris score greater than a predetermined threshold.

In some embodiments, the processor may be further configured to: performa pyramid decomposition on the previous frame image; integrate thecollected angular velocity over the time interval between the currentframe image and the previous frame image, to obtain a rotational angleof the UAV during the time interval; calculate, for each of the cornerpoints in the current frame image, a corresponding pixel displacement inthe top image layer of the previous frame image, based on the rotationalangle; and estimate, for each of the corner points in the current frameimage, an estimated area in the top image layer of the previous frameimage, based on the corresponding pixel displacement.

In some embodiments, the processor may be further configured to: extractcorner points from the previous frame image; determine if a corner pointis found within each of the estimated area in the previous frame imagewhich is corresponding to each of the corner points in the current frameimage; and search, within the each of the estimated areas in theprevious frame, for corner point corresponding to the corner point inthe current frame.

In some embodiments, the processor may be further configured to: obtaina speed of each of the corner points in the top image layer according toeach of the corner points in the current frame image and each cornerpoints in the previous frame image, by a pyramid optical flow method;and obtain successively a speed of each of the corner points in each ofimage layers other than the top image layer in the pyramid according tothe speed of each of the corner points in the top image layer, by thepyramid optical flow method, wherein a speed of the corner point in abottom image layer in the pyramid may be the speed of the corner point.

In some embodiments, the processor may be further configured to: obtainan average value of the speeds of the corner points as a first averagevalue; determine a correlation between the speed of each of the cornerpoints and the first average value, and obtain an average value of thosecorner points which are positively correlated with the first averagevalue, as a second average value, wherein the second average value maybe the pixel velocity.

In some embodiments, the processor may be further configured to obtain ahistogram of the speeds of corner points and performing a low-passfiltering on the histogram, wherein a mode obtained from the filteredhistogram may be the pixel velocity.

In some embodiments, the processor may be further configured to: obtaina rotational pixel velocity of the UAV caused by a rotation based on theangular velocity; obtain a translational pixel velocity of the UAVcaused by a translation by subtracting the rotational pixel velocitycaused by the rotation from the pixel velocity obtained according to thespeeds of the corner points; and obtain the actual speed of the UAVaccording to the translational pixel velocity and the flight altitude ofthe UAV.

In some embodiments, the processor may be further configured to use aSIMD instruction set to perform a synchronous calculation on a pluralityof pixels, to execute operations of extracting corner points from acurrent frame image, the step of searching for the corresponding cornerpoint within each of the estimated areas in the previous frame image,according to the position of each of the corner point in the currentframe image, and the step of obtaining the speed of each of the cornerpoint according to the corner point in the current frame image and thecorresponding corner point in the previous frame image.

The advantageous effects of the present disclosure is in that,distinguished from the prior arts, the technical solutions of presentdisclosure may include the following processes: extracting corner pointsfrom a current frame image; estimating corresponding corner points in aprevious frame image based on an angular velocity and the corner pointsin the current frame image; appropriately processing the corner pointsin the current frame image and the corner points in the previous frameimage to calculate a pixel velocity; and obtaining an actual speed ofthe UAV based on the pixel velocity and a flight altitude of the UAV.Compared with the methods in prior art, the technical solution ofpresent disclosure may calculate the flight parameters of aerial vehiclebased on corner points and make pre-compensation to the angular velocityinstead of post-compensation, thereby improving an accuracy and aprecision of the flight parameters measurement.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a structure diagram of a device for measuring flightparameters of a UAV, according to an embodiment of the presentdisclosure;

FIG. 2 is a flow chart of a method for measuring flight parameters of aUAV, according to a first embodiment of the present disclosure; and

FIG. 3 is a flow chart of a method for measuring flight parameters of aUAV, according to a second embodiment of the present disclosure.

DETAILED DESCRIPTION OF THE INVENTION

Particular terms are used throughout the specification and claims torefer to specific components. Those skilled in the art would appreciatethat, manufacturers may use different terms for the same component.Components are not differentiated by different terms, but by differentfunctionalities throughout the specification and claims. The presentdisclosure will be described in detail with reference to drawings andembodiments.

FIG. 1 is a structure diagram of a device for measuring flightparameters of a UAV, according to an embodiment of the presentdisclosure. As shown in FIG. 1, the device may comprise an image sensor10, a gyroscope 20, an altimeter 30 and a processor 40.

In some embodiments, the image sensor 10 may be configured to obtainimages at a first preset frequency. In some instances, the image sensormay be an MT9V034 supporting a maximum resolution of 752×480. In someinstances, the first preset frequency may be 50 Hz (Hertz).

In some embodiments, the gyroscope 20 may be configured to collect theangular velocity of a UAV at a second preset frequency. In someinstances, the second preset frequency may be a high frequency, such as1 KHz (kilohertz).

In some embodiments, the altimeter 30 may be configured to obtain theflight altitude of a UAV. In some instances, the altimeter 30 may be anultrasonic sensor. For instance, a probe of the ultrasonic sensor maytransmit an ultrasonic wave having a frequency of about 300-500 KHztowards the ground. The ultrasonic wave may be reflected when it reachesthe ground capable of reflecting the ultrasonic wave. The reflected wavemay be received by the same probe or another probe of the ultrasonicsensor. The ultrasonic sensor may measure a time difference between themoment the ultrasonic wave is transmitted and the moment reflected waveis received. The distance between the ultrasonic sensor and the groundmay be calculated based on the propagation speed (e.g., generally 340m/s) of ultrasonic wave in air. Optionally, the altimeter 30 may beother types of measurement devices such as an infrared sensor, a lasersensor or a microwave device, etc.

In some embodiments, the processor 40 may be an embedded processorelectrically connected with the image sensor 10, the gyroscope 20 andthe altimeter 30. In some instances, the processor 40 may be a Cortex M4processor which is connected with the image sensor 10 via a DCMI(digital camera interface) interface or an LVDS (low voltagedifferential signaling) interface, connected with the gyroscope 20 viaan I2C (inter-integrated circuit) interface, and connected with thealtimeter 30 via a UART (universal asynchronous receiver/transmitter)interface. Optionally, the processor 40 may be other types of embeddedprocessors or other processors, and not limited by the embodimentsherein. In some embodiments, the processor 40 may be configured to: (1)extract corner points from a current frame image captured by the imagesensor 10; (2) estimate estimated areas in a previous frame image withinwhich the corner points in the current frame image locate, according tothe current angular velocity of a UAV collected by the gyroscope 20; (3)search for corresponding corner points within the estimated areas in theprevious frame image, according to the locations of the corner points inthe current frame image; (4) obtain the speeds of the corner points,according to the corner points in the current frame image and thecorresponding corner points in the previous frame image; (5) obtainpixel velocity according to the speeds of the corner points; and (6)obtain the actual speed of the UAV according to the pixel velocity andthe flight altitude of the UAV obtained by the altimeter 30. In someembodiments, as the gyroscope 20 detects a rotation of the UAV, theprocessor 40 may calculate a rotational pixel velocity caused by therotation of the UAV based on the angular velocity detected by thegyroscope 20, and obtain the translational pixel velocity of the UAVcaused by a translation of the UAV by subtracting the rotational pixelvelocity from the pixel velocity obtained from the speeds of the cornerpoints. The actual speed of the UAV may be calculated based on thetranslational pixel velocity caused by the translation of UAV and theflight altitude obtained by the altimeter 30.

In some embodiments, the processor 40 may be a processor supportingSingle Instruction Multiple Data (SIMD) instruction set. In someinstances, SIMD instruction set may be a subset of Thumb instructionset. In some embodiments, the processor 40 may perform synchronouscalculation on a plurality of pixels by using SIMD instruction set,thereby executing operations of extracting corner points from a currentframe image, searching for corresponding corner points from estimatedareas in a previous frame image according to the locations of the cornerpoints in the current frame image, and obtaining the speeds of thecorner points according to the corner points in the current frame imageand the corresponding corner points in the previous frame image. The useof SIMD instruction set may significantly increase the executionefficiency of the operations, thereby reducing the execution time of theoperations and increasing the precision of flight parametersmeasurement.

In some embodiments, the operation of the processor 40 for extractingcorner points from a current frame image obtained by the image sensor 10may comprise the following processes. First, the processor 40 mayperform pyramid decomposition on the current frame image obtained by theimage sensor 10. Next, the processor 40 may obtain gray-scale gradientsin the horizontal direction and the vertical direction of each pixel inthe top image layer of the current frame image, the top image layer maylocate at the top of the pyramid in the pyramid decomposition. In someinstances, in the process of calculating the gray-scale gradients, SIMDinstruction set may be used to perform synchronous calculation on aplurality of pixels in order to increase the calculation speed. Forinstance, by virtue of array characteristic, every 4 bytes havingsuccessive addresses may be combined into a 32-bit integer, and acalculation may be performed by using SIMD instruction set with thecalculation speed four times faster. Next, the processor 40 may obtainthe integral image corresponding to the top image layer of the currentframe image based on the gray-scale gradients in the horizontaldirection and the vertical direction. In some instances, in the processof calculating the integral image, Thumb instruction set may be used toincrease the speed of calculating the integral image. For instance,instructions, such as _SMLABB, _SMLABT, _SMLATB in Thumb instructionset, may be used to complete a multiplication and addition calculationof 16-bit integer in one clock cycle, thereby increasing the speed ofcalculating the integral image. Then, the processor 40 may obtain theHarris score of each pixel in the top image layer of the current frameimage according to the integral image, and extract corner points of thecurrent frame image based on the Harris score. In some instances, thecorner points may be the pixels of which Harris score is greater than apredetermined threshold.

In some embodiments, the operation of the processor 40 for estimatingestimated areas in a previous frame image within which the corner pointsin the current frame image locate, according to the current angularvelocity of the UAV collected by the gyroscope 20, may comprise thefollowing processes. First, the processor 40 may perform pyramiddecomposition on the previous frame image. Next, the processor 40 mayintegrate the angular velocity collected by the gyroscope 20 over thetime interval between the current frame image and the previous frameimage to obtain the rotational angle of the UAV during the timeinterval. Next, for each corner point in the current frame image, theprocessor 40 may calculate the corresponding pixel displacement in thetop image layer of the previous frame image based on the rotationalangle. Then, based on the pixel displacement, the processor 40 mayestimate estimated areas in the top image layer of the previous frameimage within which the corner points in the current frame image locate.

In some embodiments, the operation of the processor 40 for searching forthe corresponding corner points within the estimated areas in theprevious frame image, based on the locations of the corner points in thecurrent frame image, may comprise the following processes. First, theprocessor 40 may extract corner points from the previous frame image.Next, for respective corner point, the processor 40 may determine if acorner point corresponding to the corner point in the current frameimage is found within the estimated area in the previous frame image.Then, the processor may search, in the estimated areas of the previousframe, for corner points corresponding to the corner points of thecurrent frame by pyramid optical flow algorithm.

In some embodiments, the operation of the processor 40 for obtaining thespeeds of the corner points according to the corner points in thecurrent frame image and the corresponding corner points in the previousframe image may comprise the following processes. First, for each cornerpoint, the processor 40 may obtain the speed of the corner point in thetop image layer by pyramid optical flow method, according to a cornerpoint in the current frame image and a corresponding corner point in theprevious frame image. Next, for each corner point, the processor 40 maysuccessively obtain the speed of a corner point in respective otherimage layers by pyramid optical flow method, according to the speed ofthe corner point in the top image layer. In some instances, the speed ofcorner point in the bottom image layer in the pyramid may be the speedof the corner point.

In some embodiments, the operation of the processor 40 for obtainingpixel velocity according to the speeds of corner points may comprise thefollowing processes. First, the processor 40 may obtain an average valueof the speeds of corner points as a first average value. Next, theprocessor 40 may determine a correlation between a speed of each cornerpoint and the first average value. Then, the processor 40 may obtain anaverage value of the speeds of the corner points, which are positivelycorrelated with the first average value, as a second average value. Insome instances, the second average value may be the pixel velocity.

Alternatively, the operation of the processor 40 for obtaining pixelvelocity according to the speeds of corner points may comprise thefollowing processes. The processor 40 may obtain the histogram of thespeeds of corner points, and perform low-pass filtering on thehistogram. In some instances, the mode obtained from the filteredhistogram may be the pixel velocity.

FIG. 2 is a flow chart of a method for measuring flight parameters of aUAV, according to a first embodiment of the present disclosure. Themethod of FIG. 2 may be executed by the flight parameter measuringdevice of FIG. 1. It should be noted that, the method of presentdisclosure is not limited to the flow sequence as shown in FIG. 2 giventhat substantially same result can be obtained. As shown in FIG. 2, themethod of present disclosure may comprise the following steps.

Step S101: capturing images and collecting the angular velocity of aUAV.

In step S101, the images may be obtained by the image sensor 10 at afirst preset frequency, and the angular velocity of the UAV may becollected by the gyroscope 20 at a second preset frequency.

Step S102: extracting corner points from a current frame image.

In step S102, the corner points may be extracted from current frameimage by the processor 40 by using Kitchen-Rosenfeld corner detectionalgorithm, Harris corner detection algorithm, KLT corner detectionalgorithm or SUSAN corner detection algorithm. In some instances, apixel of which the gray-scale varies significantly compared with that ofthe adjacent pixel points may be considered as a corner point.

Step S103: for each corner point, estimating an estimated area in aprevious frame image within which the corner points in the current frameimage locate, according to the current angular velocity of the UAV.

In step S103, the angular velocity collected over a time intervalbetween the current frame image and the previous frame image may beintegrated by the processor 40 to obtain the rotational angle of the UAVduring the time interval. Next, for each corner point, a pixeldisplacement during the time interval between the current frame imageand the previous frame image, which is caused by the rotation of theUAV, may be obtained based on the rotational angle. Then, based on thepixel displacement, an estimated area in the previous frame image withinwhich each corner point in the current frame image locates may beestimated.

Step S104: searching for a corresponding corner point within each of theestimated areas in the previous frame image, according to the positionof each of the corner points in the current frame image.

In step S104, the estimated area may be a square area or an area havingother shapes, which is not limited herein. The size of the estimatedarea may be determined according to an actual situation. In someinstances, a smaller estimated area may be selected if the accuracy inextracting the corner points is to be increased.

In step S104, first, the processor 40 may extract corner points in theprevious frame image by using Kitchen-Rosenfeld corner detectionalgorithm, Harris corner detection algorithm, KLT corner detectionalgorithm or SUSAN corner detection algorithm. Next, for the cornerpoints, the processor 40 may determine if a corner point correspondingto the corner point in the current frame image is found within theestimated area in the previous frame image. Then, the processor maysearch, in the estimated areas of the previous frame, for corner pointscorresponding to the corner points of the current frame by pyramidoptical flow algorithm.

Step S105: obtaining the speeds of corner points according to the cornerpoints in the current frame image and the corresponding corner points inthe previous frame image.

In step S105, the speed of a corner point may be obtained by theprocessor 40 according to the corner point in the current frame imageand the corresponding corner point in the previous frame image, by usingpyramid optical flow method or block matching optical flow method. Insome instances, the block matching approach in the block matchingoptical flow method may be a sum of absolute distance (SAD) or a sum ofsquared distance (SSD).

Step S106: obtaining pixel velocity based on the speeds of cornerpoints.

In step S106, the pixel velocity may be obtained by the processor 40according to the speeds of the corner points by using the following twomethods.

The first method may comprise the following processes. First, obtainingthe average value of the speeds of corner points as a first averagevalue. Next, determining the correlation between the speed of eachcorner point and the first average value. In some instances, if thespeed of a corner point is positively correlated with the first averagevalue, the speed of the corner point may be determined as approachingthe correct pixel velocity; otherwise, the speed of the corner point maybe determined as deviating from the correct pixel velocity. Then,obtaining an average value of the speeds of those corner points, whichare positively correlated with the first average value, as a secondaverage value. In some instances, the second average value may be thepixel velocity.

The second method may comprise the following processes. First, obtaininga histogram of the speeds of corner points. In some instances, thehistogram may include a one-dimensional histogram in the horizontaldirection and in the vertical direction. Next, performing low-passfiltering on the histogram. In some instances, a mode obtained from thefiltered histogram may be the pixel velocity. For instance, the speed ofcorner point having the highest frequency of occurrence within thehistogram may be considered as the mode.

Step S107: obtaining the actual speed of the UAV based on the pixelvelocity and the flight altitude of the UAV.

In step S107, the processor 40 may obtain a rotational pixel velocitycaused by the rotation of UAV based on the angular velocity, obtain thetranslational pixel velocity of the UAV caused by the translation of UAVby subtracting the rotational pixel velocity from the pixel velocityobtained based on the speeds of the corner points, and obtain an actualspeed of the UAV based on the translational pixel velocity and theflight altitude of the UAV.

In some embodiments, the operation of obtaining the actual speed of theUAV based on the translational pixel velocity and the flight altitude ofthe UAV may comprise the following processes. First, obtaining theflight altitude of the UAV by the altimeter 30, performing medianfiltering and low-pass filtering on the obtained flight altitude. Then,converting the translational pixel velocity into the actual speed of theUAV based on the filtered flight altitude, the focal length of the lensin the image sensor 10, the intrinsic parameters of the image sensor 10and the frequency of executing the algorithm.

In some embodiments, after the actual speed of the UAV is calculated,the calculated actual speed may be verified based on four criteria todetermine if it is a reasonable speed. The four criteria may comprise:(1) whether there is a jump in the flight altitude obtained by thealtimeter 30 during the time interval between the current frame imageand the previous frame image; (2) whether the rotational angle of theUAV, which is obtained by integrating the angular velocity collected bythe gyroscope 20 during the time interval between the current frameimage and the previous frame image, is within a predetermined range; (3)whether the total number of the corner points, which are extracted fromthe current frame image or the previous frame image, reaches apredetermined number; and (4) whether the percentage of corner points,which approaching the correct pixel velocity, reaches a predeterminedrequirement. In some instances, in calculating the actual speed of theUAV, the calculated actual speed may be determined as a reasonable speedif the four criteria are simultaneously satisfied.

In some instances, in steps S102, S104 and S105, the SIMD instructionset of the processor may be utilized to perform synchronous calculationon a plurality of pixels to improve the calculation efficiency of theabove processes and reduce the calculation time.

In the aforementioned embodiment, a method of measuring flightparameters of a UAV according to the first embodiment of the presentdisclosure may first extract corner points from a current frame image;next, estimate corresponding corner points in a previous frame imagebased on an angular velocity and the corner points in the current frameimage; next, appropriately process the corner points in the currentframe image and the corresponding corner points in the previous frameimage to determine a pixel velocity; and then, obtain an actual speed ofthe UAV based on the pixel velocity and a flight altitude of the UAV.Compared with the methods in prior art, the method of present disclosuremay calculate the flight parameters of aerial vehicle based on cornerpoints and make pre-compensation to the angular velocity instead ofpost-compensation, thereby improving an accuracy and a precision of theflight parameters measurement.

FIG. 3 is a flow chart of a method for measuring flight parameters of aUAV, according to a second embodiment of the present disclosure. Themethod shown in FIG. 3 may be executed by the flight parameter measuringdevice of FIG. 1. It should be noted that, the method of presentdisclosure is not limited to the flow sequence as shown in FIG. 3 giventhat substantially same result can be obtained. As shown in FIG. 3, themethod of present disclosure may comprise the following steps.

Step S201: capturing images and collecting the angular velocity of aUAV.

In step S201, the images may be obtained by the image sensor 10 at afirst preset frequency, and the obtained images may be sent to theprocessor 40 via a DCMI interface or an LVDS interface. In someinstances, the image sensor 10 may be an MT9V034 supporting a maximumresolution of 752×480. In some instances, the first preset frequency maybe 50 Hz (Hertz).

For instance, the resolution of the images may be set to 480×480. Afteran image having a resolution of 480×480 is obtained by the image sensor10 at the first preset frequency, the image having a resolution of480×480 may be down sampled by hardware to obtain an image having aresolution of 120×120, in order to satisfy the limitation of memory ofthe processor 40. The image having a resolution of 120×120 may be sentto the processor 40 via a DCMI interface or a LVDS interface. The abovementioned numerical values and any numerical value listed hereinafterare merely illustrative examples, and the present disclosure is notlimited thereto.

In some embodiments, the angular velocity of UAV may be collected by thegyroscope 20 at a second preset frequency. The angular velocity of UAVmay be sent to the processor 40 via an I2C interface. In some instances,the second preset frequency may be a high frequency, such as 1 KHz(kilohertz).

In some instances, the processor 40 may be a processor supporting anSIMD instruction set, such as a Cortex M4 processor. For instance, theCortex M4 processor may support the Thumb instruction set. The SIMDinstruction set may be a subset of the Thumb instruction set. Forinstance, the Cortex M4 processor may be equipped with a hardware floatpoint unit (FPU), which significantly improves a processing speed offloating-point calculation.

Step S202: performing pyramid decomposition on a current frame image.

In step S202, the processor 40 may perform pyramid decomposition on thecurrent frame image by Gaussian down-sampling or median down-sampling.In some instances, the number of layers of the decomposition may bedetermined according to an actual situation.

For instance, after a current frame image having a resolution of 120×120is obtained, the processor 40 may decomposes the image into three imagelayers by Gaussian down-sampling or median down-sampling, The threeimage layers may include an image layer having a resolution of 30×30 atthe top of the pyramid (referred to as a “top image layer”); an imagelayer having a resolution of 60×60 in the middle of the pyramid; and animage layer having a resolution of 120×120 at the bottom of the pyramid.

Step S203: obtaining gray-scale gradients of each pixel in thehorizontal direction and the vertical direction in the top image layerof the current frame image. The top image layer of current frame imagemay locate at the top of the pyramid in the pyramid decomposition.

In step S203, for instance, for each pixel in the top image layer, agray-scale gradient Ix in the horizontal direction and a gray-scalegradient Iy in the vertical direction may be calculated by the processor40. The top image layer of the current frame image may have a resolutionof 30×30.

A gray-scale gradient may be described as a value obtained by deriving atwo-dimensional discrete function if an image is described by thetwo-dimensional discrete function. In some instances, the direction ofthe gray-scale gradient may coincide with the direction of maximumchange rate of the image gray-scale, which may reflect a change ingray-scale on the edges of the image.

In some instances, the gray-scale gradient may be a difference in pixelvalues of adjacent pixels, for example, Ix=P(i+1, j)−P(I, j), andIy=P(I, j+1)−P(I, j). Optionally, the gray-scale gradient may be amedian difference, i.e., Ix=[P(i+1, j)−P(i−1, j)]/2, and Iy=[P(I,j+1)−P(I, j−1)]/2, wherein P is the pixel value of a pixel, and (i, j)is the coordinate of the pixel. Optionally, the gray-scale gradient maybe calculated by other calculation formulas.

In some embodiments, in the process of calculating the gray-scalegradients Ix and Iy, the SIMD instruction set may be used to performsynchronous calculation on a plurality of pixels, in order to increasethe calculation speed. For instance, by virtue of array characteristic,every 4 bytes having successive addresses may be combined into a 32-bitinteger, and a calculation may be performed by using the SIMDinstruction set with a calculation speed four times faster.

Step S204: obtaining an integral image corresponding to the top imagelayer of current frame image based on the gray-scale gradients in thehorizontal direction and the vertical direction.

In step S204, for instance, an integral image corresponding to the topimage layer (having a resolution of 30×30) of the current frame imagemay be obtained by the processor 40 based on the gray-scale gradients Ixand Iy of each pixel. Further, values of I_(x) ², I_(y) ² and I_(x)I_(y)of each pixel in the top image layer may be calculated based on theintegral image.

In some embodiments, in the process of calculating the integral image,the Thumb instruction set may be used to increase a speed of calculatingthe integral image. For instance, instructions such as _SMLABB, _SMLABT,_SMLATB in the Thumb instruction set may be used to complete amultiplication and addition calculation on a 16-bit integer in one clockcycle, thereby increasing the speed of calculating the integral image.

Step S205: obtaining the Harris score of each pixel in the top imagelayer of current frame image based on the integral image, and extractingcorner points in the current frame image based on the Harris score.

In step S205, for instance, the Harris score of each pixel in the topimage layer (having a resolution of 30×30) of the current frame imagemay be calculated based on the following formulae:

H = det (M) − λ × tr(M)²; ${M = \begin{bmatrix}{\sum I_{x}^{2}} & {\sum{I_{x}I_{y}}} \\{\sum{I_{x}I_{y}}} & {\sum I_{y}^{2}}\end{bmatrix}};$

Wherein H is the Harris score, det(M) is the determinant of the matrixM, tr(M) is the trace of the matrix M (the sum of eigenvalues of thematrix M), λis a preset constant, and a summation of I_(x) ², I_(y) ²and I_(x)I_(y) in the matrix M is performed in a predefined square area.

In some embodiments, after the Harris score of each pixel is calculated,the processor 40 may perform a maximum suppression on the Harris scoreof each pixel in order to extract relatively non-redundant cornerpoints. In some instances, the maximum suppression may be implemented inthe following manner. First, pixels may be sorted by the processor 40according to the Harris score of each pixel, by using such as a heapsort. Next, from the sorted pixels, those pixels having a Harris scoregreater than a predetermined threshold may be extracted. For instance, apixel having a Harris score greater than the predetermined threshold maybe a corner point. Then, in a descending order of Harris score of thecorner points, the processor 40 may check whether other corner pointscan be found within the predefined square area of corner point. If othercorner points are found within the predefined square area of cornerpoint, the other corner points appeared in the predefined square areamay be determined as invalid corner points and may be discarded.

In some instances, in the process of calculating the Harris score, anFPU may be used to perform the floating-point calculation if anycalculation on floating points is involved, thereby improving theprecision and the speed in calculating the Harris score.

Step S206: performing pyramid decomposition on a previous frame image.

In step S206, the pyramid decomposition on the previous frame image maybe similar to the pyramid decomposition to the current frame image instep S202, and the number of layers of the previous frame image and theresolution of each image layer after the decomposition may be same asthose of the current frame image, therefore, description to the processof pyramid decomposition is omitted for briefness.

Step S207: integrating the collected angular velocity over the timeinterval between the current frame image and the previous frame image toobtain the rotational angle of the UAV during the time interval.

In step S207, the processor 40 may integrate the high-frequency sampleson the angular velocity of UAV, to calculate the rotational angle of UAVduring the time interval between the current frame image and theprevious frame image. For instance, the sampling frequency may be 1 KHz.

In some instances, the angular velocity of UAV sampled by the gyroscope20 may be transmitted to the processor 40 via a hardware interface I2C.The processor 40 may read the angular velocity at a high speed by virtueof a fast and stable transmission of I2C interface. In some instances,with a fast sampling of angular velocity by the gyroscope 20, theprocessor 40 may obtain the angular velocity values with a wide rangeand a high precision.

Step S208: for each corner point in the current frame image, calculatinga pixel displacement in the top image layer of the previous frame imagebased on the rotational angle.

In step S208, for instance, for each corner point in the current frameimage, the processor 40 may calculate a pixel displacement in the topimage layer (having a resolution of 30×30) of the previous frame imagebased on the rotational angle. For instance, each corner point in thecurrent frame image may be extracted from the top image layer (having aresolution of 30×30) of the current frame image.

Step S209: based on the pixel displacement, estimating an estimated areain the top image layer of the previous frame image within which a cornerpoint in the current frame image locates.

In step S209, for instance, the processor 40 may estimate an estimatedarea in the top image layer (having a resolution of 30×30) of theprevious frame image within which a corner point in the current frameimage locates, based on the pixel displacement.

Step S210: searching for a corresponding corner point within each of theestimated areas in the previous frame image, according to the positionof each of the corner point in the current frame.

In step S210, for instance, the operation of the processor 40 forsearching for the corresponding corner points within the estimated areasin the previous frame image, based on the locations of the corner pointsin the current frame image, may comprise the following processes. Theprocessor 40 may first extract corner points in the previous frameimage. In some instances, each corner point in the previous frame imagemay be extracted from the top image layer (having a resolution of 30×30)of the previous frame image. Next, the processor 40 may determine, inthe top image layer (having a resolution of 30×30) of the previous frameimage, whether a corner point can be found within each of the estimatedarea which is corresponding to each of the corner points in the currentframe image. Then, the processor 40 may search, within each of theestimated areas of the previous frame, for corner point corresponding tothe corner point of the current frame by a pyramid optical flowalgorithm.

Step S211: obtaining the speed of each corner point in the top imagelayer, according to each corner point in the current frame image andeach corner point in the previous frame image, by a pyramid optical flowmethod.

In step S211, for instance, for each corner point, the processor 40 maycalculate a difference between pixels in the predefined square area of acorner point in the current frame image and pixels in the predefinedsquare area of a corresponding corner point in the previous frame image.Then, the processor 40 may calculate a speed of the corner point in thetop image layer (having a resolution of 30×30) by a pyramid optical flowmethod, based on gray-scale gradients of each pixel in horizontaldirection and vertical direction in the predefined square area of thecorner point in current frame image.

In some instances, if the calculated speed is a floating number, for theaccuracy of calculation, a predefined square area may be obtained byinterpolating around each corner point in the previous frame image. Theabove calculation steps may then be executed.

In some instances, in the pyramid optical flow method, Thumb instructionset may be used to increase a speed of calculation. For instance,instructions such as _SMLABB, _SMLABT, _SMLATB in the Thumb instructionset may be used to complete a multiplication and addition calculation ofa 16-bit integer in one clock cycle, thereby increasing the speed ofcalculation.

Step S212: for each corner point, successively obtaining the speed ofthe corner point in each image layer other than the top image layer inthe pyramid, according to the speed of the corner point in the top imagelayer, by a pyramid optical flow method. In some instances, a=the speedof the corner point in the bottom image layer in the pyramid may be thespeed of the corner point.

In step S212, for instance, for each corner point, the processor 40 mayfirst estimate an initial position of a corner point in an image layerhaving a resolution of 60×60, based on a speed of the corner point inthe top image layer having a resolution of 30×30. Next, the processor 40may obtain the speed of the corner point in the image layer having aresolution of 60×60 by a pyramid optical flow method. Next, theprocessor 40 may estimate an initial position of the corner point in animage layer having a resolution of 120×120, based on the speed of thecorner point in the image layer having a resolution of 60×60. Then, theprocessor 40 may obtain the speed of the corner point in an image layerhaving a resolution of 120×120 by the pyramid optical flow method. Thespeed of the corner point in the image layer having a resolution of120×120 may be the speed of the corner point.

Step S213: obtaining a pixel velocity based on the speeds of the cornerpoints.

Step S214: obtaining the actual speed of the UAV based on the pixelvelocity and the flight altitude of the UAV.

In some embodiments, steps S213 and S214 may be similar to steps S106and S107 of FIG. 2. A description to steps S213 and S214 are omitted forbriefness.

In the aforementioned embodiment, a method of measuring flightparameters of a UAV according to the second embodiment of the presentdisclosure may first extract corner points from current frame image by apyramid image method; next, estimate corresponding corner points inprevious frame image based on an angular velocity and the corner pointsin the current frame image; next, process the corner points in thecurrent frame image and corresponding corner points in the previousframe image to determine a pixel velocity by the pyramid optical flowmethod; then, obtain an actual speed of the UAV based on the pixelvelocity and a flight altitude of the UAV. Compared with the methods inprior art, the method of present disclosure may determine the flightparameters of UAV based on corner points and make pre-compensation tothe angular velocity instead of post-compensation, thereby improving anaccuracy and a precision of the flight parameters measurement.Meanwhile, by using a pyramid decomposition method, the presentdisclosure may expand a measurement range of UAV flight parameters.Furthermore, the present disclosure may improve a speed and precision incalculating UAV flight parameters by using a processor supporting SIMDinstructions and an FPU.

The foregoing disclosure is merely illustrative of the embodiments ofthe disclosure but not intended to limit the scope of the disclosure.Any equivalent structural or equivalent flow changes, which are madewithout departing from the specification and the drawings of thedisclosure, and a direct or indirect application in other relevanttechnical field, shall also fall into the scope of the disclosure.

What is claimed is:
 1. A method of measuring flight parameters of anunmanned aerial vehicle (UAV), said method comprises: capturing imagesand collecting an angular velocity of the UAV; extracting corner pointsfrom a current frame image; estimating, for each of the corner points inthe current frame image, an estimated area in a previous frame imagewithin which the corner point in the current frame image locates,according to the angular velocity of the UAV, wherein the current frameimage is captured at a first time and the previous frame image iscaptured at a second time, wherein the second time is before the firsttime; searching for a corresponding corner point within each of theestimated areas in the previous frame image, according to the positionof each of the corner points in the current frame image; obtaining aspeed of each of the corner points according to the corner point in thecurrent frame image and the corresponding corner point in the previousframe image; obtaining a pixel velocity according to the speeds of thecorner points; and obtaining an actual speed of the UAV based on thepixel velocity and a flight altitude of the UAV.
 2. The method of claim1, wherein the step of extracting corner points from the current frameimage includes: performing a pyramid decomposition on the current frameimage; obtaining gray-scale gradients in the horizontal direction andthe vertical direction of each pixel in the top image layer of thecurrent frame image, wherein the top image layer locates at the top ofthe pyramid in the pyramid decomposition; obtaining an integral imagecorresponding to the top image layer of the current frame image, basedon the gray-scale gradients in the horizontal direction and the verticaldirection; and obtaining a Harris score of each pixel in the top imagelayer of the current frame image based on the integral image, andextracting the corner points in the current frame image based on theHarris score, wherein the corner points are pixels having a Harris scoregreater than a predetermined threshold.
 3. The method of claim 2,wherein the step of estimating, for each of the corner points in thecurrent frame image, an estimated area in a previous frame image withinwhich the corner point in the current frame image locates, according tothe angular velocity of the UAV includes: performing a pyramiddecomposition on the previous frame image; integrating the collectedangular velocity over the time interval between the current frame imageand the previous frame image, to obtain a rotational angle of the UAVduring the time interval; calculating, for each of the corner points inthe current frame image, a corresponding pixel displacement in the topimage layer of the previous frame image, based on the rotational angle;and estimating, for each of the corner points in the current frameimage, an estimated area in the top image layer of the previous frameimage, based on the corresponding pixel displacement.
 4. The method ofclaim 3, wherein the step of searching for the corresponding cornerpoint within each of the estimated areas in the previous frame image,according to the position of each of the corner point in the currentframe image includes: extracting corner points from the previous frameimage; determining whether a corner point is found within each of theestimated area in the previous frame image which is corresponding toeach of the corner points in the current frame image; and searching,within the each of the estimated areas in the previous frame, for cornerpoint corresponding to the corner point in the current frame.
 5. Themethod of claim 4, wherein the step of obtaining the speeds of thecorner points according to the corner points in the current frame imageand the corresponding corner points in the previous frame imageincludes: obtaining a speed of each of the corner points in the topimage layer according to each of the corner points in the current frameimage and each of the corner points in the previous frame image, by apyramid optical flow method; and obtaining successively a speed of eachof the corner points in each of image layers other than the top imagelayer in the pyramid according to the speed of each of the corner pointsin the top image layer, by the pyramid optical flow method, wherein aspeed of the corner point in a bottom image layer in the pyramid is thespeed of the corner point.
 6. The method of claim 4, wherein the step ofobtaining the pixel velocity according to the speeds of the cornerpoints includes: obtaining an average value of the speeds of the cornerpoints as a first average value; determining a correlation between thespeed of each of the corner points and the first average value; andobtaining an average value of those corner points which are positivelycorrelated with the first average value, as a second average value,wherein the second average value is the pixel velocity.
 7. The method ofclaim 4, wherein the step of obtaining the pixel velocity according tothe speeds of the corner points includes: obtaining a histogram of thespeeds of the corner points and performing a low-pass filtering on thehistogram, wherein a mode obtained from the filtered histogram is thepixel velocity.
 8. The method of claim 1, wherein the step of obtainingthe actual speed of the UAV based on the pixel velocity and a flightaltitude of the UAV includes: obtaining a rotational pixel velocity ofthe UAV caused by a rotation based on the angular velocity; obtaining atranslational pixel velocity of the UAV caused by a translation bysubtracting the rotational pixel velocity caused by the rotation fromthe pixel velocity obtained according to the speeds of the cornerpoints; and obtaining the actual speed of the UAV according to thetranslational pixel velocity and the flight altitude of the UAV.
 9. Themethod of claim 1, wherein a SIMD instruction set of a processor is usedto perform a synchronous calculation on a plurality of pixels in thestep of extracting corner points from the current frame image, the stepof searching for the corresponding corner point within each of theestimated areas in the previous frame image, according to the positionof each of the corner point in the current frame image, and the step ofobtaining the speed of each of the corner point according to the cornerpoint in the current frame image and the corresponding corner point inthe previous frame image.
 10. A device for measuring flight parametersof an unmanned aerial vehicle (UAV), said device comprises: an imagesensor configured to capture images; a gyroscope configured to collectan angular velocity of the UAV; an altimeter configured to obtain aflight altitude of the UAV; and a processor electrically connected withthe image sensor, the gyroscope and the altimeter, said processor isconfigured to: extract corner points from a current frame image capturedby the image sensor; estimate, for each of the corner points in thecurrent frame image, an estimated area in a previous frame image withinwhich the corner points in the current frame image locate, according tothe angular velocity of the UAV collected by the gyroscope, wherein thecurrent frame image is captured at a first time and the previous frameimage is captured at a second time, wherein the second time is beforethe first time; search for a corresponding corner point within each ofthe estimated areas in the previous frame image, according to theposition of each of the corner points in the current frame image; obtaina speed of each of the corner points according to the corner point inthe current frame image and the corresponding corner point in theprevious frame image; obtain a pixel velocity according to the speeds ofthe corner points; and obtain an actual speed of the UAV based on thepixel velocity and the flight altitude of the UAV obtained by thealtimeter.
 11. The device of claim 10, wherein the processor is furtherconfigured to: perform a pyramid decomposition on the current frameimage; obtain gray-scale gradients in the horizontal direction and thevertical direction of each pixel in the top image layer of the currentframe image, wherein the top image layer locates at the top of thepyramid in the pyramid decomposition; obtain an integral imagecorresponding to the top image layer of the current frame image based onthe gray-scale gradients in the horizontal direction and the verticaldirection; obtain a Harris score of each pixel in the top image layer ofthe current frame image based on the integral image; and extract thecorner points in the current frame image based on the Harris score,wherein the corner points are pixels having a Harris score greater thana predetermined threshold.
 12. The device of claim 11, wherein theprocessor is further configured to: perform a pyramid decomposition onthe previous frame image; integrate the collected angular velocity overthe time interval between the current frame image and the previous frameimage, to obtain a rotational angle of the UAV during the time interval;calculate, for each of the corner points in the current frame image, acorresponding pixel displacement in the top image layer of the previousframe image, based on the rotational angle; and estimate, for each ofthe corner points in the current frame image, an estimated area in thetop image layer of the previous frame image, based on the correspondingpixel displacement.
 13. The device of claim 12, wherein the processor isfurther configured to: extract corner points from the previous frameimage; determine whether a corner point is found within each of theestimated area in the previous frame image which is corresponding toeach of the corner points in the current frame image; and search, withinthe each of the estimated areas in the previous frame, for corner pointcorresponding to the corner point in the current frame.
 14. The deviceof claim 13, wherein the processor is further configured to: obtain aspeed of each of the corner points in the top image layer according toeach of the corner points in the current frame image and each cornerpoints in the previous frame image, by a pyramid optical flow method;and obtain successively a speed of each of the corner points in each ofimage layers other than the top image layer in the pyramid according tothe speed of each of the corner points in the top image layer, by thepyramid optical flow method, wherein a speed of the corner point in abottom image layer in the pyramid is the speed of the corner point. 15.The device of claim 13, wherein the processor is further configured to:obtain an average value of the speeds of the corner points as a firstaverage value; determine a correlation between the speed of each of thecorner points and the first average value, and obtain an average valueof those corner points which are positively correlated with the firstaverage value, as a second average value, wherein the second averagevalue is the pixel velocity.
 16. The device of claim 13, wherein theprocessor is further configured to obtain a histogram of the speeds ofthe corner points and performing a low-pass filtering on the histogram,wherein a mode obtained from the filtered histogram is the pixelvelocity.
 17. The device of claim 13, wherein the processor is furtherconfigured to: obtain a rotational pixel velocity of the UAV caused by arotation based on the angular velocity; obtain a translational pixelvelocity of the UAV caused by a translation by subtracting therotational pixel velocity caused by the rotation from the pixel velocityobtained according to the speeds of the corner points; and obtain theactual speed of the UAV according to the translational pixel velocityand the flight altitude of the UAV.
 18. The device of claim 10, whereinthe processor is further configured to use a SIMD instruction set toperform a synchronous calculation on a plurality of pixels, to executeoperations of extracting corner points from a current frame image, thestep of searching for the corresponding corner point within each of theestimated areas in the previous frame image, according to the positionof each of the corner point in the current frame image, and the step ofobtaining the speed of each of the corner point according to the cornerpoint in the current frame image and the corresponding corner point inthe previous frame image.